package com.demo.jzoffer2;

import org.junit.Test;

/**
 * @author gy
 * @date 2022/11/15
 */
public class Test1229_01 {

    // you need to treat n as an unsigned value
    public int hammingWeight(int n) {
        int res = 0;
        while (n != 0){
            res += n & 1;
            n >>>= 1;
        }
        return res;
    }


    @Test
    public void m1() {

    }

    @Test
    public void m2(){

    }

}
